<h2>Price Entry Form</h2>

<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'price-form',
    'enableAjaxValidation' => true,
    'enableClientValidation' => true,
    'clientOptions' => array(
        'inputContainer' => 'div.control-group'
    )
        ));
?>

<div class="control-group">
    <?php echo $form->labelEx($model, 'crop_id', array('class' => 'control-label')); ?>
    <div class="controls">
        <?php echo $form->dropDownList($model, 'crop_id', CHtml::listData(Crop::model()->findAll(), 'id', 'variety'), array('prompt' => 'Select crop')); ?>
        <?php echo $form->error($model, 'crop_id', array('class' => 'help-block')); ?>
    </div>
</div>

<div class="control-group">
    <?php echo $form->labelEx($model, 'amount', array('class' => 'control-label')); ?>
    <div class="controls">
        <?php echo $form->textField($model, 'amount', array('placeholder' => 'ex. 12.75', 'size' => 50, 'maxlength' => 50)); ?>
        <?php echo $form->error($model, 'amount', array('class' => 'help-block')); ?>
    </div>
</div>

<?php echo CHtml::htmlButton($model->isNewRecord ? 'Update' : 'Save', array('type' => 'submit', 'class' => 'btn btn-primary')); ?>

<?php $this->endWidget(); ?>